package cn;

import java.util.Scanner;

public class bc {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        int[] r={0,1,5,8,9,10,17,17,20,24,30};
        int[] dp=new int[n+1];
        dp[0]=0;
        int q=0;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(i>=j){
                    dp[i]=Math.max(q,dp[i-j]+r[j]);
                    q=dp[i];
                }
            }
        }
        System.out.println(dp[n]);
    }
}
